from selenium import webdriver
from selenium.webdriver.common.by import By
import time
# 导入
# 初始化对象属性  请求百度  搜索框输入内容  点击百度一下
# 作业  seconds秒
'''
class TestCase:
    def __init__(self):
        self.driver=webdriver.Chrome()

    def get_so(self):
        self.driver.get('https://www.so.com/')
        time.sleep(2)
        self.driver.find_element(By.ID,'input').send_keys('天气预报')
        time.sleep(2)
        self.driver.find_element(By.ID,'search-button').click()
    
    def quit(self,seconds):
        time.sleep(seconds)
        self.driver.quit()

if __name__ == '__main__':
    case = TestCase()
    case.get_so()
    # case.quit()
'''

# 导入
# 初始化对象属性  请求百度  搜索框输入内容  点击百度一下
# 作业  seconds秒

class TestCase:
    def __init__(self):
        self.driver=webdriver.Chrome()

    def get_so(self):
        self.driver.get('https://www.so.com/')
        time.sleep(2)
        self.driver.find_element(By.ID,'input').send_keys('天气预报')
        time.sleep(2)
        self.driver.find_element(By.ID,'search-button').click()

    def quit(self,seconds=2):
        time.sleep(seconds)
        self.driver.quit()

if __name__ == '__main__':
    case=TestCase()
    case.get_so()
    case.quit()


class TestCase:
    def __init__(self):
        self.driver=webdriver.Chrome()

    def get_so(self):
        self.driver.get('https://www.so.com/')
        time.sleep(2)
        self.driver.find_element(By.ID,'input').send_keys('天气预报')
        time.sleep(2)
        self.driver.find_element(By.ID,'search-button').click()

    def quit(self,seconds=2):
        time.sleep(seconds)
        self.driver.quit()

if __name__ == '__main__':
    case=TestCase()
    case.get_so()
    case.quit()